#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
    pid_t id = fork();
    if(id > 0)
    {
        printf("父进程pid：%d\n",getpid());
        sleep(5);
        exit(0);
    }
    else if(id==0)
    {
        printf("子进程pid：%d\n",getpid());
        sleep(30);
    }
    else{
        perror("wrong");
        return -1;
    }
    return 0;
}
